home *** CD-ROM | disk | FTP | other *** search
- Path: combo.ganesha.com!peterk
- From: peterk@combo.ganesha.com (Dr. Peter Kittel)
- Subject: Re: Amigados - checking f
- Newsgroups: comp.sys.amiga.misc
- Reply-To: peterk@combo.ganesha.com
- References: <401.6670T240T431@nibelung.demon.co.uk> <8290833353303@shoestring.opus-networx.com>
- Message-ID: <peterk.0mrv@combo.ganesha.com>
- Date: 12 Apr 96 23:04:17 MEZ
- Organization: Private Site
-
- In article <8290833353303@shoestring.opus-networx.com> dnn@shoestring.opus-networx.com (Amigaboy) writes:
- >
- > > What would be the format to check the existence of a file in a script for
- > > dos? I would have thought something like this:
- > >
- > > If EXISTS blah:filename
- > > dowhatever
- > > else
- > > dothatinstead
- > > endif
- > > endif
- > >
- > > but this doesn't work.
- >
- > Barry, try using 'FailAt 21' before the IF EXISTS so-so-so. If blah:filename
- > was not found a non-zero return code (20) for the command would be returned
- > causing your script to fail.
-
- Sorry, this is wrong. The If is exactly thought for these cases and
- will not fail. Only one other fatal situation can occur, when there
- is no drive (or assignment for) blah:. Then a requester would pop up
- asking you to insert volume blah:. To prevent even this, you could
- precede all this with a check by "Assign blah: Exists" an a following
- "If Warn ...".
-
- --
- Best Regards, Dr. Peter Kittel // Visit http://www.amiga.de
- Private Site in Frankfurt, Germany \X/ Email to: peterk@combo.ganesha.com
- Employed at AMIGA Technologies GmbH in Bensheim, Germany
-